package com.zr.daoImpl;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import com.zr.dao.XbqdDao;
import com.zr.util.JDBCUtil;

public class XbqdDaoImpl implements XbqdDao{

	@Override
	public boolean getxbqd(String owork) {
		boolean b=false;
		StringBuffer sql=new StringBuffer("");
		sql.append("UPDATE entry SET owork=? WHERE ");
		sql.append("id in(SELECT id from(SELECT *FROM entry as a WHERE date(twork) ");
		sql.append(" in (select current_date)) a)");
		Connection con=JDBCUtil.getConnection();
		try {
			PreparedStatement  pst=con.prepareStatement(sql.toString());
			pst.setString(1, owork);
			int i=pst.executeUpdate();
			if(i>0){
				b=true;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return b;
	}

}
